<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['收费管理','电子合同[微信]']" icon="fa fa-list-alt" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>电子合同[微信]</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width:calc(100% - 280px)">
							    <div class="top_module">
                                    <span class="module_text">合同车辆</span>
                                    <sa-select2 select2ElementID="carSelect2" (optionSelected)="optionSelected($event)" matchSearch="true"></sa-select2>
                                </div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">合同编号</span>
									<input class="module_inp" [(ngModel)]="tableSearch.contractNo" type="text"/>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">甲方证件</span>
									<input class="module_inp" [(ngModel)]="tableSearch.certificate" type="text"/>
								</div>
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">电话号码</span>
                                    <input class="module_inp" [(ngModel)]="tableSearch.phone" type="text"/>
                                </div>
                                <div class="top_module top_module_box" style="min-width: auto;">
                                    <span class="top_module_label module_text">合同类型</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableSearch.contractType" style="min-width: 110px;">
                                         <option value="">全部</option>
                                        <option value="1">首次安装</option>
                                        <option value="2">服务续费</option>
                                        <option value="3">对接费</option>
                                    </select>
                                </div>
								<div class="top_module">
                                    <span class="module_text">对接厂区</span>
									<sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>
                                </div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
							</div>
							<div class="right top-search" style="width: 280px;">
								<input type="text" [(ngModel)]="tableSearch.searchKey" (change)="table_search()" class="search-input" placeholder="车牌号、合同、甲方名称、甲方证件、电话">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>合同车辆</th>
										<th>对接厂区</th>
										<th>合同编号</th>
										<th>甲方名称</th>
										<th>甲方证件</th>
										<th>电话号码</th>
										<th>合同类型</th>
										<th>合同文件</th>
										<th>签约时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.carNumber}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.contractNo}}</td>
										<td>{{row.userName}}</td>
										<td>{{row.certificate}}</td>
										<td>{{row.phone}}</td>
										<td>
										    <span *ngIf="row.contractType == 1">首次安装</span>
										    <span *ngIf="row.contractType == 2">服务续费</span>
												<span *ngIf="row.contractType == 3">对接费</span>
										</td>
										<td>
											<button type="button" (click)="open_img(row,ImgModal)" *ngIf="row.fileUrl">查看</button>
										</td>
										<td>{{row.createTime}}</td>
										<td>
											<button type="button" (click)="delContract(row)">刪除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 图片查看   弹窗-->
	<section bsModal #ImgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="imgClose(ImgModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">图片</h4>
				</div>
				<div class="modal-body">
					<div class="row form-horizontal">
						<div class="img_desc">
		            		<div class="big_img_box">
		            			<img [src]="modal.picture" alt="图片" class="picture"/>
		            		</div>
		            		<!--<ul class="small_img_box">
		            			<li class="pre_arrow arrow" [ngClass]="{notAllow:modal.activeNum == 0}">
		            				<img src="assets/img/zuojiantou.png" (click)="change_img_left()" />
		            			</li>
		            			<li class="small_img" *ngFor="let item of modal.picture;let i = index" [ngClass]="{active:modal.activeNum == i}">
		            				<img [src]="item" (mouseover)="switch_img(i)" class="img" />
		            			</li>
		            			<li class="next_arrow arrow" [ngClass]="{notAllow:modal.activeNum == modal.picture.length-1}">
		            				<img src="assets/img/youjiantou.png" (click)="change_img_right($event)"/>
		            			</li>
		            		</ul>-->
		            	</div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<!-- 图片查看 弹窗end-->
</div>
<style type="text/css">
	.small_img_box{
		text-align: center;
		padding: 12px 0;
	}
	.picture{
		min-height: 100px;
		width: 100%;
		height: auto;
	}
	.img_desc .arrow{
		display: inline-block;
		cursor: pointer;
		vertical-align: top;
		height: 80px;
		line-height: 80px;
		padding: 0 15px;
	}
	.img_desc .arrow.notAllow{
		cursor: not-allowed;
	}
	.small_img{
		width: 80px;
		height: 80px;
		overflow: hidden;
		display: inline-block;
		border:2px solid #ccc;
	}
	.small_img.active{
		border:2px solid #1A6DDD;
	}
	.small_img:hover{
		border:2px solid #1A6DDD;
	}
	.small_img .img{
		width: 100%;
		height: auto;
	}
</style>